* {
    padding: 0;
    margin: 0;
}

body {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background-color: #2f3542;
}

.loader {
    width: 150px;
    position: relative;
}

.loader div {
    position: absolute;
    left: calc(var(--i) * 30px);
    width: 30px;
    height: 30px;
    background-color: skyblue;
    z-index: 100;
    animation: move 2s linear infinite;
    animation-delay: calc(var(--i)*-400ms);
}

@keyframes move {
    0% {
        left: 150px;
        top: 0;
    }

    80% {
        left: 0;
        top: 0;
    }

    85% {
        left: 0;
        top: -30px;
        width: 30px;
        height: 30px;
    }

    88% {
        left: 0;
        top: -30px;
    }

    90% {
        width: 60px;
        height: 25px;
    }

    95% {
        left: 150px;
        top: -30px;
        width: 30px;
        height: 30px;
    }

    98% {
        left: 150px;
        top: -30px
    }

    100% {
        left: 150px;
        top: 0;
    }
}

@keyframes move1 {
    0% {
        left: 150px;
        width: 30px;
        height: 30px;
    }

    80% {
        top: 0;
        left: 0;
    }

    85% {
        top: -30px;
        left: 0;
    }

    88% {
        top: -30px;
        left: 0;
    }

    90% {
        width: 60px;
        height: 25px;
    }

    95% {
        top: -30px;
        left: -150px;
        width: 30px;
        height: 30px;
    }

    98% {
        top: -30px;
        height: -150px;
    }

    100% {
        top: 0px;
        left: 150px;
    }

}